package manage.commons.tags;

import manage.modules.dept.model.Dept;
import manage.modules.dept.service.DeptService;
import manage.modules.group.model.Group;
import manage.modules.group.service.GroupService;

/**
 * 函数，供自定义标签调用
 * 
 * @author dongji
 * @date 2012-9-6 下午03:50:19
 */
public class Functions {

	private static String BLANK_STRING = "";
	private static DeptService deptService;
	private static GroupService groupService;

	public static String getDeptName(long deptId) {
		Dept dept = deptService.select(deptId);
		if (null != dept) {
			return dept.getDeptName();
		}
		return BLANK_STRING;
	}

	public static String getGroupName(long groupId) {
		Group group = groupService.select(groupId);
		if (null != group) {
			return group.getGroupName();
		}
		return BLANK_STRING;
	}

	public static void setDeptService(DeptService deptService) {
		Functions.deptService = deptService;
	}

	public static void setGroupService(GroupService groupService) {
		Functions.groupService = groupService;
	}

}
